<%@page import="java.lang.ProcessBuilder.Redirect"%>
<%@page import="login.LoginBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<jsp:useBean id="m3" class="login.LoginBean" scope="request"/>
<jsp:useBean id="o" class="main.MainBean" scope="session"/>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:setProperty property="*" name="m3"/>
${m3.exe}

<c:if test="${m3.result==m3.getOk()}">
	${m3.setMain()}
	<jsp:setProperty name="o" property="name" value="${m3.name}"/>
	<jsp:setProperty name="o" property="email" value="${m3.email}"/>
	<c:redirect url="../Main/Main.jsp"/>
	<%
	//request.setAttribute("name",m.getName());
	//request.setAttribute("nickName",m.getNickName());
	//request.setAttribute("email",m.getEmail());
	//request.setAttribute("pass",m.getPass());
	//response.setHeader("Refresh", "0.5; URL=../Main/Main.jsp");
	//request.getRequestDispatcher("../Main/Main.jsp").include(request, response);
	%>
</c:if>
<c:if test="${m3.result==m3.getFail()}">
	
	<jsp:forward page="login.jsp"/>
	<%
	//這邊可以把錯誤訊息傳回login.jsp，在${errMessage}會接收到訊息
	//request.setAttribute("errorMessage",m.getErr().toString());
	//request.getRequestDispatcher("login.jsp").forward(request, response);
	%>
</c:if>